scoreboard players set @s faqv.villager_memory_wiper 0

execute at @s anchored eyes run function faqv:villager_memory_wiper/select_target
execute unless entity @e[tag=faqv.villager_memory_wiper.target] run return 1

data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:home
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:job_site 
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:last_slept
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:last_woken
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:last_worked_at_poi
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:meeting_point
data remove entity @n[tag=faqv.villager_memory_wiper.target] Brain.memories.minecraft:potential_job_site

tag @n[tag=faqv.villager_memory_wiper.target] remove faqv.villager_memory_wiper.target